<?php
/**
 * Created by PhpStorm.
 * User: Bu
 * Date: 2018/1/20
 * Time: 11:41
 */

namespace app\index\controller;
use houdunwang\arr\Arr;

use think\Controller;

class Common extends Controller
{
    public function __construct()
    {
        if (session('?username'))
        {
//            return $this->redirect(url('index/user/login'));
        }
    }

    public function template($tpl ='',$args=[])
    {
//        echo  ROOT_PATH;die;
        $tpl = $tpl ? : request()->action();
        return view (ROOT_PATH . 'template/'.$tpl.'.html',$args);
    }
    public function category()
    {
        $cardata= session('cart') ?  : [];
        return $cardata= $cardata['goods'] ? : [];

    }
}